package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.DriverInfo;
import com.example.demo.service.DriverInfoService;
import com.example.demo.mapper.DriverInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 18364
* @description 针对表【driver_info】的数据库操作Service实现
* @createDate 2025-02-07 11:25:25
*/
@Service
public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, DriverInfo>
    implements DriverInfoService{
    @Autowired
    DriverInfoMapper driverInfoMapper;

    @Override
    public List<DriverInfo> select(String name) {
        QueryWrapper<DriverInfo> queryWrapper=new QueryWrapper<>();
        if(name!=null){
            queryWrapper.eq("driverName",name);
        }
        queryWrapper.orderByDesc("id");

        return driverInfoMapper.selectList(queryWrapper);
    }
}




